<?php

class Core_Helper_Tag_Helper {

    public function registerSearchableRecord(array $tagNames, $recordId, $recordType){
        App::getModel('tag/keyword')->addTagRecord($tagNames, $recordId, $recordType);
        return $this;
    }

    public function unregisterSearchableRecord($recordId, $recordType){
        App::getModel('tag/keyword')->removeTagRecord($recordId, $recordType);
        return $this;
    }

    public function registerKeyword($word){
        App::getModel('tag/keyword')->registerKeyword($word);
        return $this;
    }

    public function statRecord($keyword, $accuracy = FALSE){
        return App::getModel('tag/keyword')->statRecord($keyword, $accuracy);
    }

    public function searchRecordIds($keyword, $type, $accuracy = FALSE){
        return App::getModel('tag/keyword')->searchRecordIds($keyword, $type, $accuracy);
    }

    public function getHotKeyword($count = 5){
        return App::getModel('tag/collection_keyword')->sortBy('searchcount', 'desc')->limit($count)->load();
    }
}